package com.uyaer.wheel.display.scene.el
{
	public class ElPool
	{
		private static var cloudList:Vector.<Cloud> = new Vector.<Cloud>();
		private static var loveList:Vector.<Love> = new Vector.<Love>();
		private static var popList:Vector.<Pop> = new Vector.<Pop>();
		
		/**
		 *获得云彩 
		 * @return 
		 * 
		 */		
		public static function getCloud():Cloud{
			if(cloudList.length>0){
				return cloudList.pop();
			}else{
				var cloud:Cloud = new Cloud();
				cloud.pivotX = cloud.width >> 1;
				cloud.pivotY = cloud.height;
				return cloud;
			}
		}
		/**
		 *回收云彩 
		 * @param cloud
		 * 
		 */		
		public static function recycleCloud(cloud:Cloud):void{
			cloudList.push(cloud);
		}
		/**
		 *获得love 
		 * @return 
		 * 
		 */		
		public static function getLove():Love{
			if(loveList.length>0){
				return loveList.pop();
			}else{
				var love:Love = new Love();
				love.pivotX = love.width >> 1;
				love.pivotY = love.height;
				return love;
			}
		}
		
		/**
		 *回收love 
		 * @param love
		 * 
		 */		
		public static function recycleLove(love:Love):void{
			loveList.push(love);
		}
		
		/**
		 *获得pop 
		 * @return 
		 * 
		 */		
		public static function getPop():Pop{
			if(popList.length>0){
				return popList.pop();
			}else{
				var pop:Pop = new Pop();
				pop.pivotX = pop.width >> 1;
				pop.pivotY = pop.height;
				return pop;
			}
		}
		
		/**
		 *回收pop 
		 * @param pop
		 * 
		 */		
		public static function recyclePop(pop:Pop):void{
			popList.push(pop);
		}
	}
}